<?php
 $file_handle = fopen("conf.txt", "r");
        $line = split(":",fgets($file_handle));

        $hostname= $line[0];
        $db_user= $line[1];
        $db_pass= $line[2];
        $db_name= chop($line[3]);

        fclose($file_handle);
        
       $con = mysql_connect($hostname,$db_user,$db_pass);
       
        if (!$con)
        {
            die('Could not connect: ' . mysql_error());
        }
        date_default_timezone_set('UTC');
        mysql_select_db($db_name, $con);
        
        $tabla = array();
        
        $sql = mysql_query('SELECT * FROM informe_final');
        $i=0;
        
        
        while($row = mysql_fetch_array($sql)){
            $responce->rows[$i]['id']=$row['id'];
            $responce->rows[$i]['cell']=array($row['id'],$row['fecha'],$row['nombre'],$row['parametros'],$row['autor'],$row['informes'],$row['comentario']);
            $i++;
            }
        
        echo json_encode($responce);
        
?>
